<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="/lostandfound/src/main/resources/static/js/jquery-1.10.2.min.js"></script>
</head>
<body>
    <iframe src="https://mvnrepository.com" width="100%" height="1024px" id="mvn">
        <script type="text/javascript">
            console.log('iframeownerdocument');
        </script>
    </iframe>
</body>
<script type="text/javascript">
    function crawler(value,page) {
        alert("----------------");
        console.log('iframeownerdocument');
        let fragment = $('#mvn')[0];
        let iframeownerdocument=fragment.ownerDocument;
        console.log(iframeownerdocument);
        console.log(iframeownerdocument.getElementsByTagName('div'));
        /*for (let k in fragment){
            console.log(k);
            console.log(fragment[k]);
        }*/
        /*if(!value){
            value = $('#query')[0].value;
        }
        alert("----------------");
        $('#mvn')[0].src = 'https://mvnrepository.com/search?q='+value+"&p=" + page;
        let div = $('div');
        console.log(div);
        let subtitles = $('.im > .im-header > .im-subtitle');
        console.log(subtitles);
        let length = subtitles.length;
        for (let i = 0; i < length; i++) {
            let lista = $(subtitles[i]).find('a');
            let group = lista[0].innerHTML.trim();
            let artifact=lista[1].innerHTML.trim();
            let url = "https://mvnrepository.com"+lista[1].href;
            console.log(group);
            console.log(artifact);
            console.log(url);
        }*/
    }
    crawler('spring',1);
</script>
</html>